package model.service;

import model.dao.*;
import model.entity.Book;
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class SearchAllServiceImpl implements SearchAllService {

    private JdbcTemplate template;
    private SearchAllDao searchAllDao;
    public SearchAllServiceImpl() {
        template=new JdbcTemplate(BaseDao.getDataSource());
        searchAllDao=new SearchAllDaoImpl(template);
    }


    @Override
    public List<Book> searchAll() {
        return searchAllDao.searchAll();
    }

    @Test
    public void test()
    {
        System.out.println(searchAll());
    }
}
